package com.huage_08.lesson_01;

public class MyThreadDemo {
    public static void main(String[] args) {
        Thread myThread1 = new MyThread("计时器");
        Thread myThread2 = new MyThread();

//        myThread1.run();
//        myThread2.run();

        myThread2.setName("跑步");
        myThread1.setPriority(10);
        int priority = myThread2.getPriority();
        System.out.println("跑步线程的优先级:" + priority);
        Thread.currentThread().setName("主线程");

        myThread1.setDaemon(true);
        myThread2.setDaemon(true);

        myThread1.start();
        myThread2.start();

        for(int i=0;i<10;i++){
            System.out.println(Thread.currentThread().getName()+","+i);
        }

    }
}
